<?php
namespace app\home\controller;

use app\home\model\BaseModel;
use app\home\model\IndexModel;
use app\home\model\ProductModel;
use think\Db;

class Index extends Base
{

    public function index(){


        // +----------------------------------------------------------------------
        // |  首页新闻  START    公告
        // +----------------------------------------------------------------------
        $article = new IndexModel();
        $id = 20;
        $notice =  $article->getTenNewArticle($id);
        $this->assign('notice', $notice);
        // +----------------------------------------------------------------------
        // |  首页新闻  START    热点
        // +----------------------------------------------------------------------
        $id = 21;
        $hot =  $article->getTenNewArticle($id);
        $this->assign('hot', $hot);
        // +----------------------------------------------------------------------
        // |  首页新闻  START    最新
        // +----------------------------------------------------------------------
        $id = 18;
        $activity =  $article->getTenNewArticle($id);
        $this->assign('activity', $activity);
        // +----------------------------------------------------------------------
        // |  首页新闻  START    媒体
        // +----------------------------------------------------------------------
        $id = 19;
        $media =  $article->getTenNewArticle($id);
        $this->assign('media', $media);

        // +----------------------------------------------------------------------
        // |  首页新闻分类  START
        // +----------------------------------------------------------------------
        $model = new BaseModel();
        $cate = $model->getAllCate();
        $this->assign('cate', $cate);

        // +----------------------------------------------------------------------
        // |  行业分类  START
        // +----------------------------------------------------------------------
        $model = new ProductModel();
        $getHomeviewAll = $model->getHomeviewAll();  // 全部
        $getHomeViewhot = $model->getHomeViewhot();  // 热点
        $getHomeViewNew = $model->getHomeViewNew();  // 最新
        $this->assign('getHomeviewAll', $getHomeviewAll);
        $this->assign('getHomeViewhot', $getHomeViewhot);
        $this->assign('getHomeViewNew', $getHomeViewNew);

        // +----------------------------------------------------------------------
        // |  行业选择上传需求  START
        // +----------------------------------------------------------------------
        $ProductModel = New \app\admin\model\ProductCateModel();
        $AllCate = $ProductModel ->getAllCate();
        $this->assign('AllCate', $AllCate);

        return $this->fetch();
    }

}
